<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script src="./stack.js"></script>
<script src="./queue.js"></script>
<script src="./link.js"></script>
<script>
    let link = new LinkNode()
    link.push(1)
    link.push(2)
    link.push(3)
    function decToBinary(num) {
        const s = new Stack()
        while(num > 0) {
            s.push(num % 2)
            num = Math.floor(num / 2)
        }
        let str = ''
        while(s.len() > 0) {
            str += s.pop()
        }
        return str
    }

    let nameList = ['刘猛', '黄乾坤', '刘昭阳', '康亚宁', '赵坚', '杨智宇', '刘晨曦', '孟令辉']
    function pass(nameList, num) {
        let que = new Queue()
        for(let i = 0; i< nameList.length; i++) {
            que.enqueue(nameList[i])
        }
        while(que.size() > 1) {
            for(let i=0; i< num; i++) {
                que.enqueue(que.dequeue())
            }
            que.dequeue()
        }
        return que.front()
    }

</script>
</html>